package com.yourname.xhs.dao;

import com.yourname.xhs.bean.Note;
import com.yourname.xhs.entity.User;

import java.sql.SQLException;
import java.util.List;

public interface NoteDao {
    //创建笔记
    public abstract boolean createNote(Note note, User user, String categoryName) throws SQLException;

    //删除笔记(管理员删除，可以删除所有人的笔记，看到所有id，不用担心删错了别人的id)
    public abstract int deleteNoteById(Long id);


    //删除笔记（个人）
    public abstract int deletePersonalNoteById(Long id,User user);


    //查看全部笔记  创建时间和修改时间查看的时候才插入？
    public abstract List<Note> selectAllNotes() throws Exception;

    //查看分类笔记
    public abstract List<Note> selectTypeNotes(String categoryName) throws Exception;

    //查看个人笔记
    public abstract List<Note> selectPersonalNote(User user) throws Exception;

    //查看个人的某条笔记
    public abstract Note selectPersonalNoteById(User user,Long id) throws Exception;

    //搜索笔记
    public abstract List<Note> searchNotesByTitle(String keyword) throws SQLException;
}
